Add more numeric types - #271
Conversation
|
You are missing the |
|
Should we make the numeric types with bytes 32 and below make INT since php supports this native? |
I’d keep the numeric type wrappers string-backed for consistency across all ClickHouse integer types. Although |
Review: tests fail on both supported ClickHouse versionsThanks for the PR — the wrappers follow the existing pattern ( 1. Use a realistic scale, e.g. 2. CH 26 accepts it, 21.9 does not — and both must pass ( 3. Float32 representation breaks the comparison assertion 4. Please add input validation to
throwing 5. Rebase needed Happy to merge once the above is addressed — the scope of the PR itself is very welcome. |
…rong Decimal doc claim Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Int*/UInt* fromString() now require an integer string (^-?\d+$), Float*/Decimal* require is_numeric() — Type objects bypass ValueFormatter escaping, so unvalidated input was an SQL injection vector; unit tests cover the rejected inputs - Decimal test columns use scale 2: Decimal32(9) cannot hold 1.1 (precision 9 = scale 9 leaves no integer digits) - comparison literal is CAST to the column type: Decimal vs Float64 is unsupported on CH 21, and Float32 1.1 != Float64 1.1 representation Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
I went ahead and pushed the fixes so we can ship this (merged master + two commits):
Verified locally: CH 21.9 — 431 tests OK, CH 26.3 — 420 tests OK, PHPStan and PHPCS clean on the touched files. Thanks for the contribution! |
No description provided.